package com.zlcode.cook.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/config")
@RefreshScope  // 配置进⾏热更新，可以感知到配置中心配置的变化。
public class NacosConfigController {
    @Value("${nacos.config.prod.num}")  // 读取配置
    private Integer num;

    @RequestMapping("/num")
    public Integer num() {
        return num;
    }
}
